<form method="post" action="" enctype="multipart/form-data">
    <div class="box grid_12">
        <div class="block" style="min-height: 610px;">
            <?php $this->load->view('partials/notices'); ?>
            <div class="input_group">
                <label>Chuyên mục</label>
                <span>
                    <select id="list-category" name="category">
                        <option value="<?php echo $rootCategory; ?>">-- None --</option>
                        <?php
                        if(sizeof($arrCategory) > 0)
                        {
                            foreach($arrCategory as $category)
                            {
                        ?>
                                <option value="<?php echo $category['id']; ?>" <?php echo ($arrObjDetail['category_id']==$category['id'])?'selected':''; ?>><?php echo $category['title']; ?></option>
                        <?php
                            }
                        }
                        ?>
                    </select>
                </span>
                <span>
                    <a href="javascript:;" onclick="addCategory(<?php echo $rootCategory; ?>, 'list-category')">[+]Thêm chuyên mục</a>
                </span>
            </div>

            <label>Tiêu đề bài viết</label> 
            <input title="Nhập tiêu đề bài viết" type="text" id="title" name="title" class="large" value="<?php echo $arrObjDetail['title']; ?>"> 

            <label>Mô tả bài viết</label> 
            <textarea id="intro" name="intro" style="width: 100%; height: 50px;"><?php echo $arrObjDetail['intro']; ?></textarea>

            <label>Nội dung bài viết</label>
            <div class="box grid_16 tabs" style="width: 100%; min-height: 400px; margin: 0 0 15px 0;">
                <ul class="tab_header grad_colour clearfix">
                    <li><a href="#tabs-1">Nội dung</a></li>
                    <li><a href="#tabs-2">Video</a></li>
                    <li><a href="#tabs-3">Audio</a></li>
                    <li><a href="#tabs-4">PDF</a></li>
                </ul>
                <div class="toggle_container">
                    <div id="tabs-1" class="block no_padding">
                        <br/>
                        <textarea id="content" name="content" style="width: 100%; height: 290px;"><?php echo $arrObjDetail['body']; ?></textarea>
                        <br/>
                    </div>
                    <div id="tabs-2" class="block">
                        <label>Upload video</label>
                        <div class="buttonHolder" style="width: 160px;">
                            <span id="spanVideoButtonPlaceholder"></span>
                        </div>
                        <div id="divVideoProgressContainer"></div>
                        <input type="hidden" id="video_url" name="video_url" value="<?php echo $arrObjDetail['video_url']; ?>" />
                        <div id="video_player_target" class="video_player">
                            <?php if(!empty($arrObjDetail['video_url'])) { ?>
                            <a id="video_player" href="<?php echo base_url().$arrObjDetail['video_url']; ?>" style="display:block;width:520px;height:330px"></a>
                            <?php } ?>
                        </div>
                    </div>
                    <div id="tabs-3" class="block">
                        <label>Upload audio</label>
                        <div class="buttonHolder" style="width: 160px;">
                            <span id="spanAudioButtonPlaceholder"></span>
                        </div>
                        <div id="divAudioProgressContainer"></div>
                        <input type="hidden" id="audio_url" name="audio_url" value="<?php echo $arrObjDetail['audio_url']; ?>" />
                        <div id="audio_player_target" class="video_player">
                            <?php if(!empty($arrObjDetail['audio_url'])) { ?>
                            <a id="audio_player" href="<?php echo base_url().$arrObjDetail['audio_url']; ?>" style="display:block;width:520px;height:30px"></a>
                            <?php } ?>
                        </div>
                    </div>
                    <div id="tabs-4" class="block">
                        <label>Upload file PDF</label>
                        <div class="buttonHolder" style="width: 160px;">
                            <span id="spanFileButtonPlaceholder"></span>
                        </div>
                        <div id="divFileProgressContainer"></div>
                        <input type="hidden" id="file_url" name="file_url" value="<?php echo $arrObjDetail['file_url']; ?>" />
                        <div id="file_target" class="video_player">
                            <?php if(!empty($arrObjDetail['audio_url'])) { ?>
                            <p class="pdf_icon"><?php echo $arrObjDetail['file_url']; ?></p>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>

            <button style="clear: none;"><img height="24" width="24" src="<?php echo base_url(); ?>/static/backend/images/icons/small/white/Bended%20Arrow%20Up.png"><span>Lưu thay đổi</span></button>
            <button style="clear: none;"><img height="24" width="24" src="<?php echo base_url(); ?>/static/backend/images/icons/small/white/List%20w_%20Images.png"><span>Xem trước</span></button>
        </div>
    </div>
    <div class="box grid_4">
        <div class="block form_option">
            <div class="thumbnail">
                <img id="thumbnail" width="100%" src="<?php echo $arrObjDetail['thumb']; ?>" title="Hình đại diện" alt="Hình đại diện"/>
                <input type="hidden" id="thumbnail_url" name="thumbnail_url" value="<?php echo $arrObjDetail['thumb']; ?>" />
            </div>
            <label>Upload hình đại diện</label> 
            <div class="buttonHolder">
                <span id="spanButtonPlaceholder"></span>
            </div>
            <div id="divFileProgressContainer"></div>
            <br/>
            <div class="input_group">
                <label>Từ khóa liên quan</label>
                <textarea name="keywords" title="Nhập từ khóa liên quan đến bài viết" style="width: 100%; height: 30px;"><?php echo isset($arrObjDetail['keywords'])?$arrObjDetail['keywords']:''; ?></textarea>
            </div>
            
            <div class="input_group">
                <label>Cho phép bình luận</label>
                <select name="comment">
                    <option value="0" <?php echo (!$arrObjDetail['comments_enabled'])?'selected':''; ?>>Không</option>
                    <option value="1" <?php echo ($arrObjDetail['comments_enabled'])?'selected':''; ?>>Có</option>
                </select>
            </div>
            
            <div class="input_group">
                <label>Tình trạng</label>
                <select name="status">
                    <option value="1" <?php echo ($arrObjDetail['status'])?'selected':''; ?>>Bản chính</option>
                    <option value="0" <?php echo (!$arrObjDetail['status'])?'selected':''; ?>>Bản nháp</option>
                </select>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/nicEdit/nicEdit.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/SWFUpload/swfupload.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/SWFUpload/fileprogress.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/SWFUpload/handlers.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/SWFUpload/upload-settings.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/backend/js/flowplayer/flowplayer-3.2.8.min.js"></script>
<script type="text/javascript">
    new nicEditor({maxHeight : 300}).panelInstance('content');
    var swfuImage, swfuVideo, swfuAudio, swfuFile;
    
    $(document).ready(function(){
        swfuImage = new SWFUpload(imageSettings);
        swfuVideo = new SWFUpload(videoSettings);
        swfuAudio = new SWFUpload(audioSettings);
        swfuFile = new SWFUpload(fileSettings);
        
        $( ".tabs" ).tabs({             
            selected: 1,
            collapsible: false,
            cache: true
        });
        
        <?php if(!empty($arrObjDetail['video_url'])) { ?>
        flowplayer("video_player", st_url + "/backend/js/flowplayer/flowplayer-3.2.9.swf", {
            clip: {autoPlay: false, autoBuffering: true}
        });
        <?php } if(!empty($arrObjDetail['audio_url'])) { ?>
        flowplayer("audio_player", st_url + "/backend/js/flowplayer/flowplayer-3.2.9.swf", {
            plugins: {controls: {fullscreen: false, height: 30, autoHide: false}},
            clip: {autoPlay: false, autoBuffering: true}
        });
        <?php } ?>
    });
</script>